#include "aboutstate.h"

AboutState::AboutState(Resources* res)
:State(res)
{
	_current_state = ST_About;
	_index = 1;
}


AboutState::~AboutState(void)
{
}

void AboutState::Update(float time)
{
}

void AboutState::ProcessInput(Input* input)
{
	switch (input->OnKeyDown())
	{
	case DIK_ESCAPE:
		_next_state = ST_Menu;
		_close = true;
		break;
	case DIK_LEFT:
	case DIK_RIGHT:
		if (_index == 1)
			_index = 2;
		else
			_index = 1;
		break;
	default:
		break;
	}



}

void AboutState::Render(LPD3DXSPRITE spriteHandler)
{
	if (_index == 1)
		_resources->_pd3ddv->StretchRect(_resources->_bgHelp->GetImage(), NULL, _resources->_back_buffer, NULL, D3DTEXF_NONE);
	else
		_resources->_pd3ddv->StretchRect(_resources->_bgHelp2->GetImage(), NULL, _resources->_back_buffer, NULL, D3DTEXF_NONE);
}

void AboutState::Release()
{

}